package com.hxs.hxsserver.scheduleTask;

import com.hxs.hxsserver.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 *
 */
@Component
@EnableScheduling
@Slf4j
public class ScheduleTask {
    @Resource
    private DeviceService deviceService;


    // 每两分钟执行一次,清除断链的客户端
    @Scheduled(cron = "0 */2 * * * ?")
    public void executeTask() {
        deviceService.executeTask();
    }

}
